import request from '@/utils/request'
const apix = 'dev-api'
// api地址
const api = {
	integralLogExamples: apix + '/integral/integralLog/examples',
	mostRedeemedCommodities: apix + '/integral/commodity/mostRedeemedCommodities',
	commodity_listAsc: apix + '/integral/commodity/listAsc',
	commodity_list: apix + '/integral/commodity/list',
	commodity_export: apix + '/integral/commodity/export',
	integral_commodity: apix + '/integral/commodity',
	// integral_commodity: apix + '/integral/commodity',
	integral_commodityIds: apix + '/integral/commodity/',
	getCommodityHomeGroupByType: apix + '/integral/commodity/getCommodityHomeGroupByType'
}
//积分排行榜
export function integralLogExamples(obj) {
	return request.get(api.integralLogExamples, {
		...obj
	})
}
//人气推荐商品
export function mostRedeemedCommodities(obj) {
	return request.get(api.mostRedeemedCommodities, {
		...obj
	})
}
//查询每日上新
export function commodityListAsc(obj) {
	return request.get(api.commodity_listAsc, {
		...obj
	})
}
//积分商城首页
export function getCommodityHomeGroupByType() {
	return request.get(api.getCommodityHomeGroupByType, {}, {
		isPrompt: false
	})
}

//查询商品信息列表
export function commodityList(obj) {
	return request.get(api.commodity_list, {
		...obj
	})
}
//导出商品信息列表
export function commodityExport(obj) {
	return request.post(api.commodity_export, {
		...obj
	})
}
//获取商品信息详细信息
export function commodityId(id) {
	return request.get(api.integral_commodityIds + id)
}
//新增商品信息
export function addcommodity(obj) {
	return request.post(api.integral_commodity, {
		...obj
	})
}
//修改商品信息
export function putcommodity(obj) {
	return request.put(api.integral_commodity, {
		...obj
	})
}
//删除商品信息
export function delcommodity(id) {
	return request.delete(api.integral_commodityIds + id)
}